﻿<cfsilent>
	<cfscript>
		
		propertyAdvice = getProperty("serviceFactory").getBean("studentPropertyAdvice");
		datetimeAdvice = getProperty("serviceFactory").getBean("datetimeAdvice");
		
		event.setArg("pageTitle", "学生学籍管理 - 学籍异动");
		
		termId = event.getArg("TermID");
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		currentTab = event.getArg("TabID", "labOperation");
		
		passArgs = structNew();
		structInsert( passArgs, "TID", termId );
		
		sql = "SELECT 
					a.stuchg_id, d.sct_name, 
					b.stu_id, b.stu_name, 
					a.op_description, a.change_date, 
					c.student_prop
				FROM t_stuchange a 
				   INNER JOIN t_student b ON b.stu_id = a.stu_id 
				   INNER JOIN t_student_status c ON c.stu_id = b.stu_id 
				   INNER JOIN t_stuchange_type d ON d.sct_code = a.sct_code 
				WHERE 
					a.term_id = :termId 
				ORDER BY 
					a.stuchg_id DESC";
			
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="termId", value=termId, cfsqltype = "cf_sql_char");

		rs_history = queryObj.execute( sql=sql ).getResult();
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('studentProfile')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">学籍档案</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 people"></i>学籍异动
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labOperation">class="active"</cfif> id="labOperation" tabTarget="Operation">学籍异动类别</span>
						<span <cfif currentTab eq "labHistory">class="active"</cfif> id="labHistory" tabTarget="History">学籍异动历史记录</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>

				<div id="Operation" class="tabContent">
					
					<div class="noticeBlock">
						<h3>在籍学生学籍变更</h3>
						<hr/>
					</div>
					
				
					
					<div class="clearfix">
						<ul class="UINavBoard">
							
							<li class="col3 first">
								<div class="board hasPic">
									<cfset structInsert( passArgs, "T", "11", true ) />
									<a href="<cfoutput>#buildURL('statusChangeWizardSuspend', passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon48x48 stuProfChg11"></span>
										</div>
										<div class="content">
											<h5>休学</h5>
											<p>无法继续在校学习需暂时终止学业（只保存记录）</p>
										</div>
									</a>
								</div>
							</li>
							<li class="col3">
								<div class="board hasPic">
									<cfset structInsert( passArgs, "T", "12", true ) />
									<a href="<cfoutput>#buildURL('statusChangeWizardModify', passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon48x48 stuProfChg12"></span>
										</div>
										<div class="content">
											<h5>复学</h5>
											<p>休学期满后返校<br/>（只保存记录）</p>
										</div>
									</a>
								</div>
							</li>
							<li class="col3 last">
								<div class="board hasPic">
									<cfset structInsert( passArgs, "T", "32", true ) />
									<a href="<cfoutput>#buildURL('statusChangeWizardSuspend', passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon48x48 stuProfChg32"></span>
										</div>
										<div class="content">
											<h5>注销学籍</h5>
											<p>取消该学生在本学校的注册学籍</p>
										</div>
									</a>
								</div>
							</li>
							
						</ul>
					</div>
					

				</div>
				
				<div id="History" class="tabContent">
					
					<div class="noticeBlock">
						<div class="operation">
							<a class="uiButton uiButtonSpecial" href="<cfoutput>#buildURL('studentChangeDownloadExcel', passArgs)#</cfoutput>"><i class="mrs img btnDownload"></i><span class="uiButtonText">下载历史记录</span></a>
						</div>
						<h3>学籍异动历史记录</h3>
						<hr/>
					</div>
					
					<cfif rs_history.recordCount>
							<cfset row = 0 />
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="18"></td>
										<td width="90">学号</td>
										<td>姓名</td>
										<td width="60">异动类别</td>
										<td>异动内容</td>
										<td>处理时间</td>
									</tr>
								</thead>
								<tbody>
                                    <cfloop query="rs_history" >
									
										<cfset row++ />
										<cfset structInsert(passArgs, "DOCID", rs_history.stuchg_id, true) />
										
										<cfset propertyAdvice.parseProperty(rs_history.student_prop) />
										
										<tr class="editRows <cfif not propertyAdvice.getInSchool()>alertRow</cfif>">
											<td class="index"><cfoutput>#row#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_history.stu_id#</cfoutput></span></td>
											<td><cfoutput>#rs_history.stu_name#</cfoutput></td>
											<td><cfoutput>#rs_history.sct_name#</cfoutput></td>
											<td><cfoutput>#rs_history.op_description#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#datetimeAdvice.formatDatetimeString(rs_history.change_date, 'YYYY/MM/DD')#</cfoutput></span></td>
										</tr>
									
									</cfloop>
								</tbody>
							</table>
						<cfelse>
							<div class="systemNotice">
								<p>本学期尚无存档记录</p>
							</div>
					</cfif>
					
				</div>

				
			</div>
		</li>
	</ul>
</div>